#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
	int fd;
	int pid;

	pid = fork();
	if (pid == 0) {
		execle("/bin/ls", NULL);
		exit(2);
	}

	if (waitpid(pid) < 0)
		printf("wait error\n");
	
	pid = fork();
	if (pid == 0) {
		fd = open("./abc.txt", O_RDONLY);
		close(fd);
	}

	if (waitpid(pid) < 0)
		printf("wait error\n");

	exit(0);
}

